package yassp.client;


import java.util.List;
import java.util.Map;
import java.util.Set;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Milridor
 */
class FileStore {

    static boolean hashExist(String hash) {
        return fileMap.containsKey(hash);
    }

    static void insert(File file) {
        fileMap.put(file.hash, file);
    }
    
    static File get(String hash) {
        return fileMap.get(hash);
    }
    
    static void deleteUnusedFiles(Folder root) {
        Set<String> used = root.getHashesList();
        fileMap.keySet().retainAll(used);
    }
    
    static Map<String,File> fileMap;
    
}
